<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Css过度效果</title>
  <style>
    .box {
      position: relative;
      width: 300px;
      height: 40px;
      border: 1px solid black;
    }

    .box::after {
      content: "";
      position: absolute;
      top: 15px;
      right: 15px;
      border-right: 1px solid black;
      border-bottom: 1px solid black;
      width: 10px;
      height: 10px;
      transform: rotate(45deg);
      transition: all 0.6s;
    }

    .box:hover::after {
      transform: rotate(225deg);
    }
  </style>
</head>

<body>
  <div class="box"></div>
</body>

</html>